#coding:utf-8
import datetime
import time
from dateutil.relativedelta import relativedelta
from tool import *


if __name__ == "__main__":
 startStr = '20150901'
 todayStr=time.strftime('%Y%m%d',time.localtime(time.time()))
 index=1
 while startStr<=todayStr:
     startDate = datetime.datetime.strptime(startStr, '%Y%m%d')
     endDate=startDate + relativedelta(months=+1)
     endStr= endDate.strftime('%Y%m%d')
     respText=getText(startStr,endStr)
     writeToHtml(respText,index)
     endDate=endDate + relativedelta(days=+1)
     endStr= endDate.strftime('%Y%m%d')
     startStr=endStr
     index=index+1
